package utilities;

public enum EPatterns {
	
	AbstractFactory(Configuration.getInstance().getProperty(Configuration.ABSTRACT_FACTORY_NAME), Configuration.getInstance().getProperty(Configuration.ABSTRACT_FACTORY_JSON)),
	Adapter(Configuration.getInstance().getProperty(Configuration.ADAPTER_NAME), Configuration.getInstance().getProperty(Configuration.ADAPTER_JSON)), 
	Bridge(Configuration.getInstance().getProperty(Configuration.BRIDGE_NAME), Configuration.getInstance().getProperty(Configuration.BRIDGE_JSON)), 
	Builder(Configuration.getInstance().getProperty(Configuration.BUILDER_NAME), Configuration.getInstance().getProperty(Configuration.BUILDER_JSON)), 
	ChainOfResponsability(Configuration.getInstance().getProperty(Configuration.CHAIN_OF_RESPONSABILITY_NAME), Configuration.getInstance().getProperty(Configuration.CHAIN_OF_RESPONSABILITY_JSON)), 
	Command(Configuration.getInstance().getProperty(Configuration.COMMAND_NAME), Configuration.getInstance().getProperty(Configuration.COMMAND_JSON)), 
	Composite(Configuration.getInstance().getProperty(Configuration.COMPOSITE_NAME), Configuration.getInstance().getProperty(Configuration.COMPOSITE_JSON)), 
	Decorator(Configuration.getInstance().getProperty(Configuration.DECORATOR_NAME), Configuration.getInstance().getProperty(Configuration.DECORATOR_JSON)), 
	FactoryMethod(Configuration.getInstance().getProperty(Configuration.FACTORY_METHOD_NAME), Configuration.getInstance().getProperty(Configuration.FACTORY_METHOD_JSON)), 
	Flyweight(Configuration.getInstance().getProperty(Configuration.FLYWEIGHT_NAME), Configuration.getInstance().getProperty(Configuration.FLYWEIGHT_JSON)), 
	Interpreter(Configuration.getInstance().getProperty(Configuration.INTERPRETER_NAME), Configuration.getInstance().getProperty(Configuration.INTERPRETER_JSON)), 
	Iterator(Configuration.getInstance().getProperty(Configuration.ITERATOR_NAME), Configuration.getInstance().getProperty(Configuration.ITERATOR_JSON)), 
	Mediator(Configuration.getInstance().getProperty(Configuration.MEDIATOR_NAME), Configuration.getInstance().getProperty(Configuration.MEDIATOR_JSON)), 
	Memento(Configuration.getInstance().getProperty(Configuration.MEMENTO_NAME), Configuration.getInstance().getProperty(Configuration.MEMENTO_JSON)), 
	Observer(Configuration.getInstance().getProperty(Configuration.OBSERVER_NAME), Configuration.getInstance().getProperty(Configuration.OBSERVER_JSON)), 
	Prototype(Configuration.getInstance().getProperty(Configuration.PROTOTYPE_NAME), Configuration.getInstance().getProperty(Configuration.PROTOTYPE_JSON)), 
	Proxy(Configuration.getInstance().getProperty(Configuration.PROXY_NAME), Configuration.getInstance().getProperty(Configuration.PROXY_JSON)), 
	State(Configuration.getInstance().getProperty(Configuration.STATE_NAME), Configuration.getInstance().getProperty(Configuration.STATE_JSON)), 
	StateAndStrategy(Configuration.getInstance().getProperty(Configuration.STATE_AND_STRATEGY_NAME), Configuration.getInstance().getProperty(Configuration.STATE_JSON)),
	Strategy(Configuration.getInstance().getProperty(Configuration.STRATEGY_NAME), Configuration.getInstance().getProperty(Configuration.STRATEGY_JSON)), 
//	TemplateMethod(Configuration.getInstance().getProperty(Configuration.TEMPLATE_METHOD_NAME), Configuration.getInstance().getProperty(Configuration.TEMPLATE_METHOD_JSON)), 
	Visitor(Configuration.getInstance().getProperty(Configuration.VISITOR_NAME), Configuration.getInstance().getProperty(Configuration.VISITOR_JSON)); 

	private String alternativeName;
	private String path;
	
	private EPatterns(String alternativeName, String path) {
		this.alternativeName = alternativeName;
		this.path = path;
	}
	
	public String getAlternativeName () {
		return alternativeName;
	}
	
	public String getPath() {
		return path;
	}

	public static EPatterns getRealName (String alternativeName) {
		EPatterns[] values = EPatterns.values();
		for (int i=0; i<values.length;i++) {
			if (values[i].getAlternativeName().equals(alternativeName))
				return values[i];
		}
		return null;
	}
		
}	
